package net.zretc.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

/**
 * 商品实体类
 * 用于存储手机商品的基本信息
 */
@TableName("products") // 指定数据库表名为products
public class Product {

    // 商品ID，主键，自增
    @TableId(type = IdType.AUTO)
    private Integer productId;

    // 商品名称（手机型号）
    private String productName;

    // 商品价格
    private Double productPrice;

    // 商品描述
    private String productDescription;

    // 商品图片URL
    private String productImage;

    // 商品品牌
    private String productBrand;

    // 商品库存数量
    private Integer stockQuantity;

    // 商品状态（1：上架，0：下架）
    private Integer productStatus;

    // 创建时间
    private Date createTime;

    // 无参构造函数
    public Product() {
    }

    // 有参构造函数（基本信息）
    public Product(String productName, Double productPrice, String productBrand) {
        this.productName = productName;
        this.productPrice = productPrice;
        this.productBrand = productBrand;
        this.productStatus = 1; // 默认上架
        this.createTime = new Date();
    }

    // Getter 和 Setter 方法
    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Double getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(Double productPrice) {
        this.productPrice = productPrice;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public String getProductImage() {
        return productImage;
    }

    public void setProductImage(String productImage) {
        this.productImage = productImage;
    }

    public String getProductBrand() {
        return productBrand;
    }

    public void setProductBrand(String productBrand) {
        this.productBrand = productBrand;
    }

    public Integer getStockQuantity() {
        return stockQuantity;
    }

    public void setStockQuantity(Integer stockQuantity) {
        this.stockQuantity = stockQuantity;
    }

    public Integer getProductStatus() {
        return productStatus;
    }

    public void setProductStatus(Integer productStatus) {
        this.productStatus = productStatus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Product{" +
                "productId=" + productId +
                ", productName='" + productName + '\'' +
                ", productPrice=" + productPrice +
                ", productDescription='" + productDescription + '\'' +
                ", productImage='" + productImage + '\'' +
                ", productBrand='" + productBrand + '\'' +
                ", stockQuantity=" + stockQuantity +
                ", productStatus=" + productStatus +
                ", createTime=" + createTime +
                '}';
    }
}